import 'package:flutter/material.dart';

///基类 widget
abstract class BaseStatefulWidget extends StatefulWidget {
  ///构造函数
  const BaseStatefulWidget({Key key}) : super(key: key);

  ///createState
  @override
  BaseStatefulState createState() => getState();

  ///getState
  BaseStatefulState getState();
}

///基础 state
abstract class BaseStatefulState<T extends BaseStatefulWidget>
    extends State<T> {
  ///initState
  @override
  void initState() {
    initDefaultState();
    super.initState();
  }

  ///dispose
  @override
  void dispose() {
    super.dispose();
    initDefaultDispose();
  }

  ///build
  @override
  Widget build(BuildContext context) {
    return initDefaultBuild(context);
  }

  ///进入初始化
  void initDefaultState();

  ///界面销毁
  void initDefaultDispose();

  ///界面构建
  Widget initDefaultBuild(BuildContext context);
}
